home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 12
/
012.d81
/
comal #5
< prev
next >
Wrap
Text File
|
2022-08-26
|
4KB
|
265 lines
COMAL corner-Part 5 by Jimmy Weiler
THE COMAL 0.14 OPERATING SYSTEM
- - - - - - - - - - - - - - - - - -
PART THE THIRD: GETTING SOPHISTICATED
WITH PROGRAM ENTRY AND DEVELOPMENT
- - - - - - - - - - - - - - - - - -
Command: 'SIZE'
As you write a COMAL program, part
of memory will be filled with the
program lines you type in. When you
RUN the program, more of memory fills
up with the variables it uses.
When you type SIZE the computer will
tell you how many bytes of memory are
still available for program lines or
variable storage. Free space can be
a vital consideration when you are
writing large programs.
- - - - - - - - - - - - - - - - - -
Command: 'AUTO'
When you enter AUTO, you tell COMAL
to automatically supply you with line
numbers as you enter program code.
You can select the starting line
number and the increment.
AUTO by itself supplies you with
lines starting at 0010 and increasing
by 10.
AUTO
0010 first'line
0020 second'line
0030 etcetera
AUTO followed by a single number
will supply lines starting at that
number and incrementing by 10.
AUTO 400
0400 first'line
0410 next'line
0420 etcetera
AUTO followed by two numbers will
supply lines starting at the first
number and incrementing by the second.
AUTO 1000,100
1000 first'line
1100 second'line
1200 and'so'on
You can stop automatic line
numbering by moving off the line with
the cursor keys.
Line numbers are needed to keep your
program lines in order. COMAL,
unlike BASIC, does NOT use line
numbers as references for branching.
Because you don't need to pay much
attention to line numbers, AUTO allows
the programmer to ignore that bit of
overhead and concentrate on the REAL
work of writing code.
- - - - - - - - - - - - - - - - - -
Command: 'RENUM'
This is, of course, the COMAL
"renumber" command. It changes the
line numbers in your entire COMAL
program.
RENUM by itself will renumber your
program starting with 0010 and
incrementing by 10.
RENUM followed by a number will
renumber your program so that the
first line has that number and the
other lines increment by 10.
Example:
RENUM 100
RENUM followed by two numbers will
make your program lines start with
the first number and increment by the
second.
Example:
LIST
0010 PRINT "HOME";
0020 PRINT "ON THE RANGE."
RENUM 100,50
LIST
0100 PRINT "HOME";
0150 PRINT "ON THE RANGE."
In general, there is no reason to
renumber a COMAL program unless you
need to insert an instruction between
two lines whose line numbers differ by
one.
- - - - - - - - - - - - - - - - - -
Command: 'DEL'
You remove a line or a range of
lines from a COMAL program with the
DEL command. In BASIC you can
delete a line by merely typing its
number. In COMAL, that line would
still exist in the program, although
its contents may be changed.
Example:
Before:
LIST
100 //
105 PRINT "THERE IS NOTHING"
110 PRINT "YOU CAN'T DO WITH"
300 PRINT "COMAL, FOR ITS"
400 PRINT "STRUCTURE IS"
500 PRINT "GOOD."
DEL 100 -- deletes line 100
DEL 110,400 -- deletes all lines from
110 through 400
After:
LIST
105 PRINT "THERE IS NOTHING"
500 PRINT "GOOD."
- - - - - - - - - - - - - - - - - -
Command: 'EDIT'
When you LIST a COMAL program, the
line numbers are set off to the side
to make it more readable. However,
when you want to change a program
line, you want it to look all crunched
up, like BASIC.
The EDIT command is an alternate
way to list so that lines are easier
to modifiy. You can EDIT lines one at
a time or specify a range of lines to
EDIT.
Example:
LIST 100
0100 PRINT 'WHEN I EDIT THIS, IT WILL
LOOK A LOT BETTER.'
EDIT 100
0100 PRINT 'WHEN I EDIT THIS, IT WILL
LOOK A LOT BETTER.'
If you were to edit the first
example, the resulting code might
print something like this:
WHEN I EDIT THIS, IT WILL LOOK A
LOT BETTER.
If you edit the second example, you
can be sure that the content would
not change.
WHEN I EDIT THIS, IT WILL LOOK A LOT
BETTER.
- - - - - - - - - - - - - - - - - -
This concludes our introduction to
the COMAL operating system. Now you
are ready to start learning the COMAL
language.
--------------------------------------